﻿using Microsoft.Extensions.DependencyInjection;
using SqlSugar;

namespace App.SqlSugar {

    public static class SqlSugarRegisterExtension {

        public static void UseSqlSugarRegisterExtension(this IServiceCollection services)
        {
            services.AddScoped(typeof(RegisterBase<>));
        }
    }


    /// <summary>
    /// 自定义仓储
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class RegisterBase<T> : SimpleClient<T> where T : class, new() {
        public RegisterBase(ISqlSugarClient db)
        {
            base.Context = db;
        }
    }
}
